#include <stdio.h>

void Seq(int arrange[], int n)
{
	int i, j, k, t;
	for (i = 0; i < n-1; i++)
	{
		for (j = 0; j < n - 1 - i; j++)
		{
			if (arrange[j] < arrange[j + 1])
			{
				t = arrange[j]; arrange[j] = arrange[j = 1]; arrange[j + 1] = t;
			}
		}
	}
}

int main()
{
	int a[5];
	for (int i = 0; i < 5; i++)
	{
		scanf_s("%d", &a[i]);
	}
	for (int j = 0; j < 5; j++)
	{
		printf("%d,", a[j]);
	}
	printf("\n");
	Seq(a, 5);
	for (int j = 0; j < 5; j++)
	{
		printf("%d,", a[j]);
	}
	return 0;
}